package dao.impl;

import dao.StudentDao;
import mapper.StudentMapper;
import mapper.UserMapper;
import org.apache.ibatis.session.SqlSession;
import pojo.Student;
import pojo.User;
import service.StudentService;
import util.MybatisUtil;

public class StudentDaoImpl implements StudentDao {
    private static SqlSession session = null;
    @Override
    public Student login(String username) {
        Student student=null;
        try {
            session = MybatisUtil.createSqlSession();
            student = session.getMapper(StudentMapper.class).login(username);
            return student;
        }finally {
            session.close();
        }
    }
}
